<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 1. 顺序执行
    var num1 = 10
    var num2 = 20
    var result1 = num1 + num2
    var result2 = num1 + num2
    // 2.分支语句
    var isLogin = true
    if (isLogin) {
      console.log("访问购物车")
      console.log("访问个人中心")
    } else {
      console.log("跳转到登录页面")
    }

    // 3.循环语句
    var i = 0
    while (i < 10) {
      console.log("执行循环语句")
      i++
    }
  </script>
</body>

</html>